﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:models="clr-namespace:ZFCNew.ViewModels" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" xmlns:controls="clr-namespace:ZFCNew.Controls" xmlns:ZFCNew_Vectors="clr-namespace:ZFCNew.Vectors"
	x:Class="ZFCNew.Views.FeedReader"
	mc:Ignorable="d"
	UseLayoutRounding="True">
    <UserControl.Resources>
        <models:FeedReaderModel x:Key="FeedReaderModelDataSource" />

    </UserControl.Resources>
    <Border BorderThickness="4" Width="750" Height="595">
        <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource FeedReaderModelDataSource}}" Margin="0">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click" SourceObject="{Binding ElementName=NextBtn}">
                    <i:InvokeCommandAction Command="{Binding GetNextResultSetCommand}"/>
                </i:EventTrigger>
                <i:EventTrigger EventName="Click" SourceObject="{Binding ElementName=PrevBtn}">
                    <i:InvokeCommandAction Command="{Binding GetPreviousResultSetCommand}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
            <ItemsControl ScrollViewer.VerticalScrollBarVisibility="Hidden" ItemsSource="{Binding CurrentColl}" Margin="30,63,0,20" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" >
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid x:Name="grid" RenderTransformOrigin="0.914,0.5" Width="704" Margin="0,5,0,0">
                            <Grid.RenderTransform>
                                <CompositeTransform/>
                            </Grid.RenderTransform>
                            <VisualStateManager.CustomVisualStateManager>
                                <ei:ExtendedVisualStateManager/>
                            </VisualStateManager.CustomVisualStateManager>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="MouseHover">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0" To="MouseHoverState"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="MouseHoverState">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="grid">
                                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="3"/>
                                                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="normal"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="MouseEnter">
                                    <ei:GoToStateAction StateName="MouseHoverState"/>
                                </i:EventTrigger>
                                <i:EventTrigger EventName="MouseLeave">
                                    <ei:GoToStateAction StateName="normal"/>
                                </i:EventTrigger>

                            </i:Interaction.Triggers>
                            <Grid>

                                <Rectangle Margin="0,0,48,0" Stroke="#FFFFC700" VerticalAlignment="Center" Height="100" RadiusX="15" RadiusY="15" StrokeThickness="2" Fill="Black"/>
                                <TextBlock x:Name="textBlock" TextWrapping="Wrap" Text="{Binding Text, FallbackValue=Hello hello baby I got something up on say ... i have got my service here and what to say say say .. your breaking up on me. Sorry I cant hear you its kind a crazy ...}" Margin="12,15,116,15" Foreground="White" FontSize="16" FontFamily="Lucida Sans Unicode" TextTrimming="WordEllipsis" MaxHeight="86" Visibility="Collapsed"/>
                                <Ellipse Width="120" x:Name="MainEllipse" Height="120" HorizontalAlignment="Right" Stroke="#FFFFC700" StrokeThickness="5" Fill="#FF111111" Cursor="Hand"  />
                                <Viewbox HorizontalAlignment="Right" Margin="0" Width="120" Height="120" IsHitTestVisible="False">
                                    <ZFCNew_Vectors:Zakumi Width="100" Height="100" RenderTransformOrigin="0.5,0.5" Margin="0,0,75,91">
                                        <ZFCNew_Vectors:Zakumi.RenderTransform>
                                            <CompositeTransform ScaleX="0.25" ScaleY="0.25"/>
                                        </ZFCNew_Vectors:Zakumi.RenderTransform>
                                    </ZFCNew_Vectors:Zakumi>
                                </Viewbox>
                                <Ellipse Width="120" Height="120" HorizontalAlignment="Right" Stroke="#FFFFC700" StrokeThickness="5" IsHitTestVisible="False">
                                    <Ellipse.Fill>
                                        <ImageBrush ImageSource="{Binding Links, Converter={StaticResource ImageUrlConverter}}" />
                                    </Ellipse.Fill>
                                </Ellipse>
                                <controls:HtmlTextBlock
									Margin="12,15,116,15" VerticalContentAlignment="Top" FontSize="14" FontFamily="Lucida Sans Unicode" TextWrapping="Wrap" Text="{Binding Summary.Text, Converter={StaticResource HtmlTextConverter}}" Foreground="White"   />
                                <HyperlinkButton
									HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,117,18" FontWeight="Bold" TargetName="_blank" Content="Read more" NavigateUri="{Binding Links, Converter={StaticResource FirstUrlConverter}}" Style="{StaticResource LinkWithoutBorderStyle}" d:LayoutOverrides="GridBox" Foreground="#FFFFC700"   />

                            </Grid>
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            <TextBlock TextWrapping="Wrap" Text="Results from feed" VerticalAlignment="Top" Foreground="#FF555555" FontSize="24" FontFamily="Franklin Gothic Heavy" Margin="0,28,22,0" HorizontalAlignment="Right"/>
            <Button x:Name="NextBtn" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="61" Margin="0,0,200,-6" Style="{StaticResource NextPrevButtonStyle}" Height="29" IsEnabled="{Binding CanGoNext, Mode=OneWay}" Background="#FFFFC700" />
            <Button x:Name="PrevBtn" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="61" Margin="200,0,0,-6" Style="{StaticResource NextPrevButtonStyle}" Height="29" RenderTransformOrigin="0.5,0.5" IsEnabled="{Binding CanGoPrev, Mode=OneWay}" Background="#FFFFC700" >
                <Button.RenderTransform>
                    <CompositeTransform ScaleX="-1"/>
                </Button.RenderTransform>
            </Button>
        </Grid>
    </Border>
</UserControl>